package com.lee.study.shouji.ui;

import com.lee.study.shouji.R;
import com.lee.study.shouji.adapter.MainUIAdapter;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.GridView;
import android.app.Activity;
/**
 * @description 应用程序的主界面
 *
 * @author AlexLee
 *
 * @Create 2013-5-30 上午10:33:55
 */
public class MainActivity extends Activity implements OnItemClickListener {

	private static final String TAG = "MainActivity";
	public GridView gv_main;
	public MainUIAdapter mainUIAdapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		gv_main = (GridView) findViewById(R.id.gv_main);
		
		mainUIAdapter = new MainUIAdapter(this);
		gv_main.setAdapter(mainUIAdapter);
		
		gv_main.setOnItemClickListener(this);
		
		//长按手机防盗
		gv_main.setOnItemLongClickListener(new OnItemLongClickListener() {

			@Override
			public boolean onItemLongClick(AdapterView<?> parent, View view,
					int position, long id) {

					if(position == 0){
						
					}
				
				return false;
			}
		});
		
	}
	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {
		Log.i(TAG,":" +position);
	}

}
